class Ball:
    def setName(self,name,password):
        self.name = name
        self.password = password
    def kick(self):
        print("我叫 %s,密码是 %d ，噢~谁踢我？！" % (self.name ,self.password))

# a = Ball()
# a.setName("飞火流星",1)
# b = Ball()
# b.setName("团队之星",2)
# c = Ball()
# c.setName("土豆",3)
# a.kick()
# b.kick()
# c.kick()

class photo:
    age = 20
    def __init__(self,name):
        self.name = name
    def kick(self):
        print("我叫%s，噢~谁踢我？！" % self.name)

p = photo('土豆')
print(p.name)
p.kick()

class person :
    __age = 20
    def __init__(self,name):
        self.__name = name
    def getName(self):
        return self.__name
    def getAge(self):
        return self.__age
# people = person('里斯')
# # print(people.__age)   # 'person' object has no attribute '__age'
# print(people.getName() + str(people.getAge()))
# print(people._person__age)   # 20

#继承
# class zhang(person):
#     pass
# z = zhang('张三')
# print(z.getName())

class man:
    def __init__(self):
        self.sex = '男人'
    def run(self):
        print("%s 要动起来！" % self.sex)

class wang(man):
    def __init__(self,age):
        # 调用未绑定的父类方法
        # man.__init__(self)
        # 使用super 函数
        super().__init__()
        self.age = age
    def speak(self):
        print('我的年龄是：%d' % self.age)
# w = wang(40)
# w.speak()
# w.run()

# 多重继承
class lisi(person,man):
    def __init__(self,name):
        person.__init__(self,name)
        man.__init__(self)
    pass
li = lisi('李四')
li.run()
print(li.getName())
